import request from "../request.js"
//  登录
function doLogin(data){
	return request({
		url:"/lejuClient/login/doLogin",
		data:data,
		method:"POST"
	})
}
//  注册
function register(data){
	return request({
		url:"/lejuClient/member/register",
		data:data,
		method:"POST"
	})
}
// 获取用户信息
function getMemberInfo(data){
	return request({
		url:"/lejuClient/login/getMemberInfo",
		data:data
	})
}
// 更新用户信息
function updateMemberInfo(data){
	return request({
		url:"/lejuClient/member/updateMemberInfo",
		data:data,
		method:"POST"
	})
}
// 地址列表
function findAllAddress(data){
	return request({
		url:"/lejuClient/address/findAllAddress",
		data:data
	})
}
// 删除地址
function delAddressInfo(addressId,data){
	return request({
		url:`/lejuClient/address/delAddressInfo/${addressId}`,
		data:data,
		method:"delete"
	})
}
// 切换默认状态
function switchDefault(addressId,defaultStatus,data){
	return request({
		url:`/lejuClient/address/switchDefault/${addressId}/${defaultStatus}`,
		data:data,
		method:"post"
	})
}
// 更新地址
function updateAddressInfo(data){
	return request({
		url:"/lejuClient/address/updateAddressInfo",
		data:data,
		method:"post"
	})
}
// 添加地址
function addAddressInfo(data){
	return request({
		url:"/lejuClient/address/addAddressInfo",
		data:data,
		method:"post"
	})
}
export {
	doLogin,
	register,
	getMemberInfo,
	findAllAddress,
	delAddressInfo,
	switchDefault,
	updateAddressInfo,
	addAddressInfo,
	updateMemberInfo
}